package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    /*
    * 添加套餐表的分类
    * */
    void insertBatch(List<SetmealDish> setmealDishes);
/*
* 查询表中是否关联菜品
* */
    @Select("select count(id) from setmeal_dish where dish_id=#{DishId}")
    Integer getByid(Long id);
/*
* 根据主键id查询数据
* */
    @Select("select * from setmeal_dish where setmeal_id=#{id}")
    List<SetmealDish> setBid(Long id);
/*
* 根据id删除菜品
* */
    @Delete("delete from setmeal_dish where setmeal_id= #{id}")
    void DelectBid(Long id);
/*
* 根据id删除套餐内的菜品
* */
    @Delete("delete from setmeal_dish where setmeal_id=#{id}")
    void DelectDishBid(Long id);
}
